import { request } from '../utils/request';
const store = '/store/api';
const scope = 'store';
import { get } from '../utils/uniapi';
//扫码入座
export class api {
	//获取功能列表
	static feature() {
		return request(store, { scope, cmdCode: 'MCH_FEATURE_LIST', mchId: get('mchId') });
	}
	//扫码获取桌号
	static seated(data: any) {
		return request(store, { scope, cmdCode: 'MCH_DESK_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//检验用户信息
	static userxx() {
		return request(store, { scope, cmdCode: 'STORE_MEMBER_POST', mchId: get('mchId') });
	}
	//菜品分类信息
	static dishescla(data: any) {
		return request(store, { scope, cmdCode: 'GOODS_CAT_LIST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//菜品详情
	static Dtlgoods(data: any) {
		return request(store, { scope, cmdCode: 'GOODS_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//加入菜品购物车
	static addcaicrt(data: any) {
		return request(store, { scope, cmdCode: 'GOODS_CART_POST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//购物车列表
	static cartList(data: any) {
		return request(store, { scope, cmdCode: 'GOODS_CART_LIST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//删除购物车菜品
	static eletcai(data: any) {
		return request(store, { scope, cmdCode: 'GOODS_CART_DEL', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//编辑购物车数据
	static editcart(data: any) {
		return request(store, { scope, cmdCode: 'GOODS_CART_PATCH', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//下单
	static orders(data: any) {
		return request(store, { scope, cmdCode: 'ORDERS_POST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//查看订单列表
	static orders_list(data: { page: any; size: any }) {
		return request(store, {
			scope,
			cmdCode: 'ORDERS_LIST',
			mchId: get('mchId'),
			pageIndex: data.page,
			pageSize: data.size
		});
	}
	//查看订单
	static chaorders(data: any) {
		return request(store, { scope, cmdCode: 'ORDERS_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//用户支付
	static userpay(data: any) {
		return request(store, { scope, cmdCode: 'PAY_PAYMENT_POST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//查看积分记录
	static points(data: { page: any; size: any }) {
		return request(store, {
			scope,
			cmdCode: 'MEMBER_FINANCE_LOG_LIST',
			mchId: get('mchId'),
			pageIndex: data.page,
			pageSize: data.size
		});
	}
	//加入vip
	static joinvip(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_JOIN', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//获取用户
	static getuser() {
		return request(store, { scope, cmdCode: 'MEMBER_GET', mchId: get('mchId') });
	}
	//修改用户
	static putuser(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_PATCH', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//获取商户信息
	static getmch(data: any) {
		return request(store, { scope, cmdCode: 'MCH_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//充值活动
	static payList(data: any) {
		return request(store, { scope, cmdCode: 'MKT_POINTS_LIST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//充值活动详情
	static payGet(data: any) {
		return request(store, { scope, cmdCode: 'MKT_POINTS_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//支付
	static pay(data: any) {
		return request(store, { scope, cmdCode: 'PAY_PAYMENT_POST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//用户流水
	static payflowList(data: { page: any; size: any }) {
		return request(store, {
			scope,
			cmdCode: 'PAY_PAYMENT_LIST',
			mchId: get('mchId'),
			pageIndex: data.page,
			pageSize: data.size
		});
	}
	//申请退款9
	static payrefund(data: any) {
		return request(store, { scope, cmdCode: 'ORDERS_RETURN_POST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//退款列表
	static payrefundList(data: { page: any; size: any; data: any }) {
		return request(store, {
			scope,
			cmdCode: 'ORDERS_RETURN_LIST',
			mchId: get('mchId'),
			pageIndex: data.page,
			pageSize: data.size,
			source: JSON.stringify(data.data)
		});
	}
	//获取用户手机号
	static phone(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_MOBILE_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	static cnacelpay(data: any) {
		return request(store, { scope, cmdCode: 'PAY_PAYMENT_DEL', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	//地址
	static addAddress(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_ADDRESS_POST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	static addressList(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_ADDRESS_LIST', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	static addressGet(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_ADDRESS_GET', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	static addressPut(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_ADDRESS_PATCH', mchId: get('mchId'), source: JSON.stringify(data) });
	}
	static addressDel(data: any) {
		return request(store, { scope, cmdCode: 'MEMBER_ADDRESS_DEL', mchId: get('mchId'), source: JSON.stringify(data) });
	}
}
